<html>
	<head>
		<script type="application/javascript;version=1.7" src="lib/jsdefs.js" > </script>
		<script type="application/javascript;version=1.7" src="lib/jslex.js" ></script>
		<script type="application/javascript;version=1.7" src="lib/jsparse.js" ></script>
		<script type="application/javascript;version=1.7" src="lib/jsresolve.js" ></script>
		<script type="application/javascript;version=1.7" src="lib/jsexec.js" ></script>
		<title>Narcissus in HTML w jq clean</title>
	</head>
	<body>
		<h3 id="test">evaluating HTML test</h3>
		<script type="text/javascript;version=1.7">
			 //<![CDATA[
			try{
				document.cookie='mysecretcookie=testcookie';
				var data = "<div>" +
				"<div>"+
					"<p ONCLICK=\"this.style.border='2px dashed #333'; alert(document.cookie);\" style=\"background:url('javascript:alert(document.cookie)'); border:1px solid #345;\"> ONGeVEER= problem o_O</p>" +
					"<META HTTP-EQUIV='refresh' CONTENT='0;url=javascript:alert(document.cookie);'>" +
					"<a HREf='javascript:alert(document.cookie);'>link</a>" + 
					"<img onload='alert(document.cookie);' src='http://www.w3schools.com/images/w3schoolslogo.gif'/>" + 
					"<img src='http://www.w3schools.com/images/w3schoolslogo.gif' oNloaD=\"alert('onLoad: ' + document.cookie)\" />" + 
					"<scri"+"pt>alert('script: '+document.cookie);document.write('<p>inscriptwrite</p>');</scr"+"ipt>" + 
					"<p onclick=\"document.writeln('<p>lol</p><scrip"+"t>alert(document.cookie);</scrip"+"t>')\">write</p>" +
					"<img src='javascript:alert(document.cookie);' alt='naughtjs'/>" +
					"<scr"+"ipt>var onload = 'regex success';alert(onload);</scr"+"ipt>" +
					"<p>Script1 " +
						"<scri"+"pt>//<![CDATA[ \n" +
							"document.getElementById('test').innerHTML = 'evaluating html test(repl)<sc'+'r"+"ipt>alert(document.cookie);</sc'+'r"+"ipt>'; " +
							"var s = document.getElementsByTagName('script')[0];" +
							"var script = document.createElement('script');" +
							"script.appendChild(document.createTextNode(\"alert('createScript: ' + document.cookie);\")); " + 
							"s.parentNode.insertBefore(script, s); \n" + 
						"//]]>\n </scri"+"pt>" +
					"</p>" +
					"<p>Script2 " +
						"<scri"+"pt>" +
							"var an = document.createElement('a');" +
							"an.appendChild(document.createTextNode('click here')); " + 
							"an.text = 'click here';" + 
							"an.href = 'javascript:alert(document.cookie)'; " + 
							"document.body.appendChild(an); " + 
							"var f = document.createElement('iframe'); " +
							"f.src= 'http://schefk.es'; " +
							"f.onload = function(){alert('loaded');}; " +
							"document.body.appendChild(f); " +
						"</scri"+"pt>" +
					"</p>" +
//				"<scr"+"ipt>document.location = 'http://www.google.com';</scri"+"pt>" +
//				"<scr"+"ipt>document.location = 'javascript:alert(document.cookie);';</scri"+"pt>" +
//				"<scr"+"ipt>window.location = 'javascript:alert(document.cookie);';</scri"+"pt>" +
				"<scr"+"ipt>window.location = 'http://www.google.be';</scri"+"pt>" +
				"</div></div>" + 
//				"<iframe src='http://schefk.es' onload='alert(document.cookie);'/>" +
				"<h3>DONE</h3>";
				Narcissus.interpreter.evaluate("var window = this;", {'domaccess-read' : 'no', 'domaccess-write' : 'yes', 'cookie-read' : 'yes' ,'extcomm' : 'no'});
				Narcissus.interpreter.evaluate("var win = window.open(''); alert(win.navigator.geolocation.getCurrentPosition);");
				//Narcissus.interpreter.evaluateHTML(data);
				//alert(Narcissus.interpreter.global);
				//alert(Narcissus.interpreter.globalMirror);
			} catch(e) {
				alert("spider: " + e.name+": "+e.message);
			}
			/*
					if(v.propertyName == "text"){
						var props="";
						for(var i in v.base){
								props += i+" : "+v.base[i]+"\n";
						}
						//alert(props);
					}
			*/
			// alert("success");
			//]]>
		</script>
	</body>
</html>